<?php
/**
 * Example FSM state class. Prints incoming characters
 *
 * @author chedim
 */
class oFsmStatePrinter implements oInterfaceFsmState
{
    private $buffer = array();
    public function PushElement($element)
    {
        $this->buffer[] = $element;
        return $this->ExecBuffer();
    }

    protected function ExecBuffer() {
        $c = array_shift($this->buffer);
        if (is_array($c)) {
            $c = implode('', $c);
        }
        echo $c;
        return $this;
    }
}
?>
